<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">

        <title>电商后台管理系统</title>

        <link rel="stylesheet" id="css-main" href="/assets/css/oneui.min.css">
        <style>
            button a{color: #fff;}
            button a:hover{color: #fff;}
            td img{width: 50px;}
        </style>
    </head>
    <body>
        <div id="page-container" class="sidebar-o sidebar-dark enable-page-overlay side-scroll page-header-fixed">
            
            <%- include("./nav.ejs") %>

            <%- include("./header.ejs") %>
            
            <!-- Main Container -->
            <main id="main-container">
                <div class="block">
                    <div class="block-header">
                        <h3 class="block-title">Default Table</h3>
                        <div class="block-options">
                            <div class="block-options-item">
                                <button type="button" class="btn btn-primary">
                                    <a href="/goods/add">添加信息</a>
                                </button>
                                <a href="/goods/upload" class="btn btn-primary">导入信息</a>
                            </div>
                        </div>
                    </div>
                    <div class="block-content">
                        <table class="table table-vcenter">
                            <thead>
                                <tr>
                                    <th>序号</th>
                                    <th>名称</th>
                                    <th>图片</th>
                                    <th>分类</th>
                                    <th>品牌</th>
                                    <th>logo</th>
                                    <th width=100>
                                        价格
                                        <a href="/goods/sort?price=-1"><i class="fa fa-sort-numeric-down"></i></a>
                                        <a href="/goods/sort?price=1"><i class="fa fa-sort-numeric-up-alt"></i></a>
                                    </th>
                                    <th>
                                        库存
                                        <a href="/goods/sort2?stock=-1"><i class="fa fa-sort-numeric-down"></i></a>
                                        <a href="/goods/sort2?stock=1"><i class="fa fa-sort-numeric-up-alt"></i></a>
                                    </th>
                                    <th>销量</th>
                                    <th>折扣</th>
                                    <th>评分</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <% for(let i=0;i<data.length;i++){ %>
                                    <tr>
                                        <td><%= i+1 %></td>
                                        <td><%= data[i].goodsName %></td>
                                        <td><img src="<%= data[i].goodsImg %>" alt=""></td>
                                        <td><%= data[i].kind %></td>
                                        <td><%= data[i].brand %></td>
                                        <td><img src="<%= data[i].logo %>" alt=""></td>
                                        <td><%= data[i].price %></td>
                                        <td><%= data[i].stock %></td>
                                        <td><%= data[i].sales %></td>
                                        <td><%= data[i].discount %></td>
                                        <td><%= data[i].tip %></td>
                                        <td class="text-center">
                                            <div class="btn-group">
                                                <a href="/goods/set?id=<%= data[i].goodsId %>" class="btn btn-sm btn-light js-tooltip-enabled">
                                                    <i class="fa fa-fw fa-pencil-alt"></i>
                                                </a>
                                                <a href="/goods/del?id=<%= data[i].goodsId %>" class="btn btn-sm btn-light js-tooltip-enabled" >
                                                    <i class="fa fa-fw fa-times"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                <% } %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </main>
            <!-- END Main Container -->
            
            <%- include("./footer.ejs") %>
        </div>
        <script src="/assets/js/oneui.core.min.js"></script>
        <script src="/assets/js/oneui.app.min.js"></script>
        <script src="/assets/js/plugins/chart.js/Chart.bundle.min.js"></script>
        <script src="/assets/js/pages/be_pages_dashboard.min.js"></script>
    </body>
</html>
